use crate::handlers::tenant_handler::handle_create_tenant;
use crate::resource::tenant::entity::tenant::Tenant;
use warp::Filter;

pub fn tenant_route() -> impl Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
    warp::path("tenant").and(warp::path("index"))
        .and(warp::post())
        .and(warp::body::json())
        .and_then(|tenant: Tenant| async move {
            Ok::<_, warp::Rejection>(handle_create_tenant(tenant).await)
        })
}